<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>cqw</title>
    <style>
      body {
        margin: 0;
        padding: 0;
      }
      .box {
        display: flex;
        gap: 0.5rem;
        flex-wrap: wrap;
        container-type: inline-size;
        /* container容器元素，而cqw是容器宽度单位，1cqw=1%的容器宽度，100cqw就是容器宽度 */
      }
      .box img {
        width: calc(25cqw - 1.5rem / 4);
        height: calc(25cqw - 1.5rem / 4);
        object-fit: cover;
      }
    </style>
  </head>
  <body>
    <div class="box">
      <img src="./1.jpg" />
      <img src="./2.jpg" alt="" />
      <img src="./3.jpg" alt="" />
      <img src="./4.png" alt="" />
    </div>
  </body>
</html>
